package dian.qing.li.demo.security.config.listener;

import dian.qing.li.demo.security.service.AppReadyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 上下文已经准备完毕的时候触发,用于预处理
 *
 * @program: seedland_uc_git
 * @description:
 * @author: EC_liqingdian
 * @create: 2020-04-30 09:44
 **/
@Slf4j
@Component
public class AppReadyListener implements ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    @Qualifier("dian.qing.li.demo.security.service.impl.RequestReadyServiceImpl")
    private AppReadyService requestReadyServiceImpl;


    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        // 请求RequestMapping初始化
        requestReadyServiceImpl.ready();
    }
}
